package Menu;

import javax.swing.*;

import java.awt.Color.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import Menu.menu;

public class entradas extends JDialog{
	private static final int Miguel = 0;
	private Panel contenedor1 =new Panel();
	private Panel contenedor2 =new Panel();
	private Panel contenedor3 =new Panel();
	private Button botonescoja =new Button("Sel. Scanner");
	private Button botonescanea =new Button("Escan Imagen 1");
	private Button botonnueva =new Button("Nueva Imagen 2+"); 
	private Button botonguarda=new Button("Guarda Imagen");
	private Button botonelimina=new Button("Elimina Imagen");
	private Button botonregresa = new Button ("Retorno Menu");
	
	private List lista = new List(Miguel);
	private Frame menuvar;
	
	private JLabel labelcontenedor2= new JLabel ("IMAGEN ESCANEDA SIN GUARDAR");
	private JLabel labelcontenedor3= new JLabel ("INGRESA DATOS A LA BASE DE DATOS");
	
	private JLabel labelcajitadoc= new JLabel ("No. Documento");
	private JTextField cajitadoc= new JTextField("");
	private JLabel labelcajita2= new JLabel ("Fecha");
	private JTextField cajita2=new JTextField("");
	private JLabel labelcajita3= new JLabel ("No. Cedula");
	private JTextField cajita3=new JTextField("");
	private JLabel labelcajita4= new JLabel ("Valor");
	private JTextField cajita4=new JTextField("");
	private JLabel labelcheck1=new JLabel("OCR Imagen 1");
	private Checkbox check1 = new Checkbox("");
	private Button botonguardabd = new Button ("Guardar Registro");
	private JLabel labelbarras= new JLabel ("INGRESA CODIGO DE BARRAS UNO o RESMAS");
	
	public entradas  (Frame menupar ){
		menuvar = menupar;		
		contenedor1.setBackground(java.awt.Color.pink);
		contenedor2.setBackground(java.awt.Color.blue);
		contenedor3.setBackground(java.awt.Color.green);
		setLayout (null);
		contenedor1.setLayout(null);
		contenedor2.setLayout(null);
		contenedor3.setLayout(null);
				
		setTitle ("Menu Entradas");
		setSize(900, 600);
		contenedor1.setBounds(130, 30, 610, 40);
		botonescoja.setBounds(5, 5, 100, 30);
		botonescanea.setBounds(105, 5, 100, 30);
		botonnueva.setBounds(205, 5, 100, 30);
		botonguarda.setBounds(305, 5, 100, 30);
		botonelimina.setBounds(405, 5, 100, 30);
		botonregresa.setBounds(505, 5, 100, 30);
		
		contenedor2.setBounds(30, 80, 530, 450);
		labelcontenedor2.setBounds(60, 10,300,20);
		lista.setBounds(10, 40, 510, 400);
				
		contenedor3.setBounds(570, 80, 300, 450);
		labelcontenedor3.setBounds(60,10,300,20);
		labelcajitadoc.setBounds(20, 40, 100, 20);
			cajitadoc.setBounds(130,40, 120,20);
		labelcajita2.setBounds(20, 70, 100, 20);
			cajita2.setBounds (130, 70, 120, 20);
		labelcajita3.setBounds(20, 100, 100, 20);
			cajita3.setBounds (130, 100, 120, 20);
		labelcajita4.setBounds(20, 130, 100, 20);
			cajita4.setBounds (130, 130, 120, 20);
		labelcheck1.setBounds (20, 150, 100, 20);
			check1.setBounds  (130,150,10,30);
		botonguardabd.setBounds(130, 180, 100, 30);
		labelbarras.setBounds(20, 230, 280, 30);
		
		botonescoja.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (e.getSource() == botonregresa){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		botonescanea.addActionListener(new  ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (e.getSource() == botonescanea){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		botonnueva.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				if (e.getSource() == botonnueva){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		botonguarda.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				if (e.getSource() == botonguarda){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		botonelimina.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				if (e.getSource() == botonelimina){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		botonregresa.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (e.getSource() == botonregresa){
					setVisible(false);
					menuvar.setVisible(true);
				}
			}
		});
		
		contenedor1.add(botonescoja);
		contenedor1.add(botonescanea);
		contenedor1.add(botonnueva);
		contenedor1.add(botonguarda);
		contenedor1.add(botonelimina);
		contenedor1.add(botonregresa);
		contenedor2.add(labelcontenedor2);
		contenedor2.add(lista);
		contenedor3.add(labelcontenedor3);
		contenedor3.add(labelcajitadoc);
		contenedor3.add(cajitadoc);
		contenedor3.add(labelcajita2);
		contenedor3.add(cajita2);
		contenedor3.add(labelcajita3);
		contenedor3.add(cajita3);
		contenedor3.add(labelcajita4);
		contenedor3.add(cajita4);
		contenedor3.add(labelcheck1);
		contenedor3.add(check1);
		contenedor3.add(botonguardabd);
		contenedor3.add(labelbarras);
		
		add(contenedor1);
		add(contenedor2);
		add(contenedor3);
		
		setVisible(true);
	}
}
